import request from '@/utils/request';
import { ICustomerInfoVO, ICustomerInfoDTO, ICustomerInfoQuery } from '.';

export function fetchList(query?: IPaginationQuery & ICustomerInfoQuery): IPaginationResWrapper<ICustomerInfoVO> {
	return request({
		url: '/oa/customerInfo/page',
		method: 'get',
		params: query,
	});
}

export function addObj(obj?: ICustomerInfoDTO): IResWrapper<ICustomerInfoVO> {
	return request({
		url: '/oa/customerInfo',
		method: 'post',
		data: obj,
	});
}

export function getObj(id?: string): IResWrapper<ICustomerInfoVO> {
	return request({
		url: '/oa/customerInfo/' + id,
		method: 'get',
	});
}

export function delObjs(ids?: string[]) {
	return request({
		url: '/oa/customerInfo',
		method: 'delete',
		data: ids,
	});
}

export function putObj(obj?: ICustomerInfoDTO): IResWrapper<ICustomerInfoVO> {
	return request({
		url: '/oa/customerInfo',
		method: 'put',
		data: obj,
	});
}
